<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <div id="box1" class="box-class">
            <span>123</span>
            <p>p1</p>
            <p class="p2">p2 <span>7777</span></p>
        </div>
        <div id="box2" class="box-class">box2</div>
        <div id="box3">box3</div>
        <div id="box4">222ox32222</div>
        <div id="box5" class="box-class">22222222</div>
        <div id="box6" class="box-class">22222222</div>
        <div></div>
    </body>
    <script src="./jquery-3.6.1.js"></script>
    <script>
        //练习选择器
        // 1.笔记内的选择器
        // 2.文档内未讲的也练习一遍

        // const divObj = document.getElementsByTagName('div')
        // for (let i = 0; i < divObj.length; i++) {
        //     divObj[i].innerHTML = 999999999999
        // }
        // document.getElementsByTagName('div')[1].innerHTML = 666666
        //页面加载完毕后执行
        $(function () {
            //标签选择器
            // $('div').html('888888888')
            // $('.box-class').html('888888888')
            // $('#box1,#box5').html('8888')
            // $('#box1>p').html('6666')
            // $('#box1>span').html(5555)
            // $('#box1 + p').html(444)
            // $('div:not(#box3)').html(44444444)
            // $('div:contains("ox3")').html('00000')
            $('div:empty').html('00000')
        })
    </script>
</html>
